home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga CD-ROM Collection
/
Amiga CD-ROM Collection - Auge 4000 and Cactus and Demo Util.iso
/
auge4000
/
46
/
lib
/
fd
/
fcntl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-06-20
|
650b
|
43 lines
/*
* FCNTL.C
*
* (c)Copyright 1990, Matthew Dillon, All Rights Reserved
*/
#include <stdio.h>
#include <stdlib.h>
#include <ioctl.h>
#include <fcntl.h>
#include <errno.h>
int
fcntl(fd, req, arg)
int fd;
int req;
int arg;
{
_IOFDS *d;
switch(req) {
case F_DUPFD:
return(ioctl(fd, IOC_DUP, NULL));
case F_GETFD:
arg = -1;
ioctl(fd, IOF_GET|IOC_CEXEC, &arg);
return(arg);
case F_SETFD:
return(ioctl(fd, IOF_SET|IOC_CEXEC, &arg));
case F_GETFL:
arg = -1;
ioctl(fd, IOF_GET|IOC_MODES, &arg);
return(arg);
case F_SETFL:
return(ioctl(fd, IOF_SET|IOC_MODES, &arg));
}
errno = EBADF;
return(-1);
}